{% extends 'base.html' %}
{% load static %}

{% block head %}
<title>{{request.user.first_name}}'s Profile</title>
{% endblock %}

{% block content %}

    <div class="col-md-10">
        <p><h3>Welcome {{ request.user.first_name }} {{request.user.last_name}}</h3></p>
        <div class="row">
            <div class="col-md-6">
                <div id="interviewTrendYear"></div>
            </div>
            <div class="col-md-6">
                <div id="roundsUserInYear"></div>
            </div>
        </div>


        {% if my_rounds %}
            <p><h3> Upcoming rounds : {% for round in my_rounds %}</h3></p>
                <ol class="list-group">
                 <p>
                    <li class="list-group-item list-group-item-info">
                        <strong>{{ forloop.counter }}. Position : </strong>{{ round.interview.position.name }}
                </p>
                     <p><strong>Candidate Name :</strong> {{ round.interview.candidate.name }}</p>
                     <p><strong>Date :</strong> {{ round.date|date }} at {{ round.contact_time }} </p>
                     <p><strong>Type : </strong>{{ round.get_round_type_display }}</p>
                     <p><strong>Interview Link: </strong><a href={% url 'Evaluator:interview_details' round.interview.pk %}>{{round.interview}}</a></p>
                            {% if request.user.is_superuser %}
                              <p><strong>Result : </strong><span class="label label-info">{{ round.interview.get_result_display }}</span></p>
                            {% endif %}
                            {% if round.interview.question_set.pk %}
                         	  <p><strong>Exam Link : </strong><a href={% url 'Evaluator:question_set_details' round.interview.question_set.pk %}>{{round.interview.question_set.name}}</a></p>
                            {% endif %}
                    </li>

                {% endfor %}
                </ol>
        {% else %}
          <h3>No rounds scheduled </h3>
        {% endif %}
    </div>

    <div class="col-md-2">
        <p>It is {% now "jS F Y H:i" %}</p>
        <div class="row well" style="margin-bottom: 10px; margin-top: 50px">
            <h3 style="margin-top:0px;margin-bottom:20px"><span  class="label label-primary">Interview Tools</span></h3>
            <p><a href="{% url 'Evaluator:add_interview' %}">Schedule Interview</a></p>
            <p><a href="{% url 'Evaluator:all_interview' %}">All Interviews</a></p>
        </div>
        <div class="row well" style="margin-bottom: 20px; margin-top: 20px">
                <h3 style="margin-top:0px;margin-bottom:20px"><span  class="label label-primary">Candidate</span></h3>
                <p><a href="{% url 'Evaluator:add_candidate' %}">Add Candidate</a></p>
                <p><a href="{% url 'Evaluator:all_candidates' %}">All Candidates</a></p>
                <p><a href="{% url 'Evaluator:bulk_upload_candis' %}">Bulk Create Candidates</a></p>
        </div>

        <div class="row well">
            <h3 style="margin-top:0px;margin-bottom:20px"><span  class="label label-primary">Q & A</span></h3>
    	    <p><a href="{% url 'Evaluator:add_question' %}">Add Question</a></p>
            <p><a href="{% url 'Evaluator:question_list' %}">All Questions</a></p>
        </div>
    	<div class="row well">
            <h3 style="margin-top:0px;margin-bottom:20px"><span  class="label label-primary">Exam Tools</span></h3>
    	    <p><a href="{% url 'Evaluator:allQueSets' %}">All QuestionSets</a></p>
           	    <p><a href="{% url 'Evaluator:createQuestionSet' %}">Create Que Set</a></p>
        </div>
    </div>


<script src="https://code.highcharts.com/highcharts.js"></script>


<script>
    var chart = new Highcharts.Chart({
      chart: {
          renderTo: 'interviewTrendYear',
          type: 'line',
          height: '50%',
      },
      title: {
          text: 'Interview Trend'
      },

      xAxis: {
          categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
      },
      yAxis: {
          title: {
            text: 'Interviews scheduled'
          }
      },
       series: [{
          name: 'No of interviews',
          data: {{ interview_count }},
          color: 'red',
        }],

      });
</script>

<script>
    var chart = new Highcharts.Chart({
      chart: {
          renderTo: 'roundsUserInYear',
          type: 'line',
          height: '50%',
      },
      title: {
          text: 'Rounds this year for {{ request.user.first_name }}'
      },

      xAxis: {
          categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
      },
      yAxis: {
          title: {
            text: 'Rounds Scheduled'
          }
      },
       series: [{
          name: 'No of rounds',
          data: {{ rounds_user_year }},
          color: '#57b230',
        }],

      });
</script>

{% endblock %}



